﻿using SrBBSPro.BaseClasses;
using System;
using NPoco;

namespace SrBBSPro.Entities
{
    [TableName("HolidayNote")]
    [PrimaryKey(new string[] { "Id", "No" }, AutoIncrement = false)]
    public class HolidayNote : BaseDoubleEntity
    {

        public DateTime StartDate { get; set; } 

        public DateTime EndDate { get; set; } 

        [Reference(ReferenceType.OneToOne, ColumnName = "Id", ReferenceMemberName = "Id")]
        public HolidayCount HolidayCount { get; set; }

        [Reference(ReferenceType.OneToOne, ColumnName = "No", ReferenceMemberName = "Id")]
        public User User { get; set; }

        [Ignore]
        public int Days
        {
            get =>  MinusDate(EndDate, StartDate);
        }

    }
}
